package org.squirrel.modules.system.auth.enums;

import org.squirrel.common.util.SpringContextUtils;
import org.squirrel.modules.system.auth.config.YuezyAuthPropertyConfig;
import org.squirrel.modules.system.auth.config.YuezyzwAuthPropertyConfig;

public enum ExAuthThridSource implements ExAuthSource {
	YUEZY {
		@Override
		public String authorize() {
			YuezyAuthPropertyConfig yuezyAuthPropertyConfig = SpringContextUtils.getBean(YuezyAuthPropertyConfig.class);
			return yuezyAuthPropertyConfig.getAuthorize();
		}

		@Override
		public String accessToken() {
			YuezyAuthPropertyConfig yuezyAuthPropertyConfig = SpringContextUtils.getBean(YuezyAuthPropertyConfig.class);
			return yuezyAuthPropertyConfig.getAccessToken();
		}

		@Override
		public String userInfo() {
			YuezyAuthPropertyConfig yuezyAuthPropertyConfig = SpringContextUtils.getBean(YuezyAuthPropertyConfig.class);
			return yuezyAuthPropertyConfig.getUserInfo();
		}
		
		@Override
		public String logout() {
			YuezyAuthPropertyConfig yuezyAuthPropertyConfig = SpringContextUtils.getBean(YuezyAuthPropertyConfig.class);
			return yuezyAuthPropertyConfig.getLogout();
		}
	},
	YUEZYZW{
		@Override
		public String authorize() {
			YuezyzwAuthPropertyConfig yuezyzwAuthPropertyConfig = SpringContextUtils.getBean(YuezyzwAuthPropertyConfig.class);
			return yuezyzwAuthPropertyConfig.getAuthorize();
		}

		@Override
		public String accessToken() {
			YuezyzwAuthPropertyConfig yuezyzwAuthPropertyConfig = SpringContextUtils.getBean(YuezyzwAuthPropertyConfig.class);
			return yuezyzwAuthPropertyConfig.getAccessToken();
		}

		@Override
		public String userInfo() {
			YuezyzwAuthPropertyConfig yuezyzwAuthPropertyConfig = SpringContextUtils.getBean(YuezyzwAuthPropertyConfig.class);
			return yuezyzwAuthPropertyConfig.getUserInfo();
		}
		
		@Override
		public String logout() {
			YuezyzwAuthPropertyConfig yuezyzwAuthPropertyConfig = SpringContextUtils.getBean(YuezyzwAuthPropertyConfig.class);
			return yuezyzwAuthPropertyConfig.getLogout();
		}
	}
}
